<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<!-- HTML file produced from file: manual.tex --
 -- using Hyperlatex v 2.3.1 (c) Otfried Cheong--
 -- on Emacs 21.4 (patch 12) "Portable Code" XEmacs Lucid, Wed Jun  2 18:56:52 2004 -->
<HEAD>
<TITLE>Scheme 48 Manual -- Command levels</TITLE>

</HEAD><BODY BGCOLOR="#ffffff">
<EM>Scheme 48 Manual</EM> | <A HREF="s48manual.html#top_node">Contents</A> | In Chapter: <A HREF="s48manual_11.html">Command processor</A><BR>Previous: <A HREF="s48manual_12.html">Current focus value and <TT>##</TT></A> | Next: <A HREF="s48manual_14.html">Logistical commands</A>
<H2>Command levels</H2>
<P>If an error, keyboard interrupt, or other breakpoint occurs, or the
 <CODE>,push</CODE> command is used, the command
 processor invokes a recursive copy of itself, preserving the dynamic state of
 the program when the breakpoint occured.
The recursive invocation creates a new <EM>command level</EM>.
The command levels form a stack with the current level at the top.
The command prompt indicates the number of stopped levels below the
 current one: <CODE>&gt;</CODE> or <CODE>:</CODE> for the
 base level and <CODE><CODE><I>n</I></CODE>&gt;</CODE> or <CODE><CODE><I>n</I></CODE>:</CODE> for all other levels,
 where <CODE><I>n</I></CODE> is the command-level nesting depth.
The <CODE>auto-levels</CODE> switch
 described below can be used to disable the automatic pushing of new levels.
<P>The command processor's evaluation package and the value of the
 <CODE>inspect-focus-value</CODE> switch are local to each command level.
They are preserved when a new level is pushed and restored when
 it is discarded.
The settings of all other switches are shared by all command levels.
<P><DL><DT><B></B><DD><I>&lt;</I>eof<I>&gt;</I><BR>Discards the current command level and resumes running the level down.
    <I>&lt;</I>eof<I>&gt;</I> is usually
    control-<CODE>D</CODE> at a Unix shell or control-<CODE>C</CODE> control-<CODE>D</CODE> using
    the Emacs <CODE>cmuscheme48</CODE> library.
<P><DT><B></B><DD><CODE>,pop</CODE><BR>The same as <I>&lt;</I>eof<I>&gt;</I>.
<P><DT><B></B><DD><CODE>,proceed [<CODE><I>exp</I></CODE> ...</CODE>]<BR>Proceed after an interrupt or error, resuming the next command
 level down, delivering the values of <CODE><I>exp&nbsp;...</I></CODE> to the continuation.
 Interrupt continuations discard any returned values.
 <CODE>,Pop</CODE> and <CODE>,proceed</CODE> have the same effect after an interrupt
 but behave differently after errors.
 <CODE>,Proceed</CODE> restarts the erroneous computation from the point where the
 error occurred (although not all errors are proceedable) while
 <CODE>,pop</CODE> (and <I>&lt;</I>eof<I>&gt;</I>) discards it and prompts for
 a new command.
<P><DT><B></B><DD><CODE>,push</CODE><BR>Pushes a new command level on above the current one.
 This is useful if the <CODE>auto-levels</CODE> switch has been used
 to disable the automatic pushing of new levels for errors and interrupts.
<P><DT><B></B><DD><CODE>,reset [<CODE><I>number</I></CODE>]</CODE><BR>Pops down to a given level and restarts that level.
  <CODE><I>Number</I></CODE> defaults to zero, <CODE>,reset</CODE> restarts the command
  processor, discarding all existing levels.
<P></DL>
<P>Whenever moving to an existing level, either by sending
 an <I>&lt;</I>eof<I>&gt;</I>
 or by using <CODE>,reset</CODE> or the other commands listed above,
 the command processor runs all of the <CODE>dynamic-wind</CODE> "after" thunks
 belonging to stopped computations on the discarded level(s).
<P><P>
  
Previous: <A HREF="s48manual_12.html">Current focus value and <TT>##</TT></A> | Next: <A HREF="s48manual_14.html">Logistical commands</A></BODY></HTML>
